#include "Load.h"
#include "Match.h"
#include <iostream>
using namespace std;

int main(int argc, const char* argv[])
{
	char path_WA_Nodes[1000];
	char path_WA_Edges[1000];
	char path_WA_EdgeGeometry[1000];
	char path_input[1000];
	char path_output[1000];
	if(argc == 4)
	{
		sprintf(path_WA_Nodes, "%s/%s", argv[1], "/WA_Nodes.txt");
		sprintf(path_WA_Edges, "%s/%s", argv[1], "/WA_Edges.txt");
		sprintf(path_WA_EdgeGeometry, "%s/%s", argv[1], "/WA_EdgeGeometry.txt");
		sprintf(path_input, "%s", argv[2]);
		sprintf(path_output, "%s", argv[3]);
		Load load;
		printf("Start loading WA_Nodes data...\n");
		load.ACT001_loadWA_Node(path_WA_Nodes);
		printf("Loading WA_Nodes data finishes\n");
		printf("Start loading WA_Edges and WA_EdgeGeometry data...\n");
		load.ACT002_loadWA_Edge(path_WA_Edges, path_WA_EdgeGeometry);
		printf("Loading WA_Edges and WA_EdgeGeometry data finishes\n");
		Match match(&load);
		match.ACT001_startTrainData(path_input, path_output);
	}
	else
	{
		printf("Error, You should input mapmatch [RoadNetworkInfo_Path] [Input_Path] [Output_Path]\n");
	}
	system("pause");
	return 0;
}